package cn.school.workflow.service;

import cn.school.workflow.entity.ActReProcdef;
import cn.school.workflow.entity.TenantFlow;
import cn.school.workflow.vo.WorkFlowHiVO;
import cn.school.workflow.vo.WorkFlowVO;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

public interface WorkFlowCommonService {
    /**
     * 查询流程部署信息
     * @param vo
     * @return
     */
    IPage<ActReProcdef> findProcessDeployList(ActReProcdef vo);

    /**
     * 创建
     * @param vo
     */
    String createProcessInstance(WorkFlowVO vo);

    /**
     * 撤销申请
     * @param processInstance
     * @param reason
     * @return
     */
    Boolean cancelApply(String processInstance,String reason);

    /**
     * 查询审批历史
     * @param processInstanceId
     * @return
     */
    List<WorkFlowHiVO> historyWorkFlowList(String processInstanceId);

    /**
     * 流程审批
     * @param vo
     * @return
     */
    WorkFlowVO processWorkFlow(WorkFlowVO vo);

    /**
     * 获取流程信息，已经结束的流程不能获取
     * @param processInstanceId
     * @return
     */
    WorkFlowVO workFlowInfo(String processInstanceId);

    /**
     * 查询当前用户的待办任务
     * @return
     */
    IPage<WorkFlowVO> findCurrUserToDoTasks(WorkFlowVO vo);

    /**
     * 查询上级审批人
     * @return
     */
    List<String>  findAssigneeList(List<Long> deptId);

    /**
     * 查询审批历史
     * @param vo
     * @return
     */
    IPage<WorkFlowVO> findHistoryApproval(WorkFlowVO vo);

    //多租户
    List<ActReProcdef> findAllDeployFlow();

    int tieUpTenant(TenantFlow tenantFlow);

    ActReProcdef findFlowByTypeAndTenant(TenantFlow tenantFlow);

    int deleteTaskList(List<String> taskIdList);
    //多租户
//    InputStream getFlowImgByProcInstId(String procDefId, String procInstId, boolean showHistory) throws Exception;


}
